/**
 * <p>
 * Created on 2006-7-4 16:12:12 <br>
 * Copyright (c) 2006, All rights reserved.
 * </p>
 * @author Widen
 */
package com.widen.prima.util;

import java.util.Comparator;

import com.widen.prima.finance.entites.AccountSubjectBo;

public class AccountSubjectComparator
    implements Comparator
{

    public int compare(Object o1, Object o2)
    {
        AccountSubjectBo bo1 = (AccountSubjectBo) o1;
        AccountSubjectBo bo2 = (AccountSubjectBo) o2;
        if (bo1 == null && bo2 == null)
        {
            return 0;
        } else if (bo1 == null && bo2 != null)
        {
            return -1;
        } else if (bo1 != null && bo2 == null)
        {
            return 1;
        } else
        {
            String code1 = bo1.getSubjectCode();
            String code2 = bo2.getSubjectCode();
            return code1.compareTo(code2);
        }
    }

}
